<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%
request.setCharacterEncoding("GB2312");
%>
<%
String username = String.valueOf(session.getAttribute("username"));
int mas = Integer.parseInt(String.valueOf(session.getAttribute("master")));
int boardid= Integer.parseInt(request.getParameter("boardid"));
username = username.trim();
if(!(username.equals("null"))){
	if(mas == boardid){
%>
<jsp:useBean id="delsubject" scope="page" class="dsp.web.Subject"/>
<jsp:setProperty name="delsubject" property="id" param="subjectid"/>
<jsp:setProperty name="delsubject" property="username" param="username"/>
<%
delsubject.setPath(request.getRealPath("/"));
delsubject.delSubject();
if(delsubject.isStatus()){
	response.setHeader("Pragma", "no-cache");
	response.setHeader("Expires", "0");
	response.sendRedirect("forum.jsp?boardid="+request.getParameter("boardid"));
}
else{
	out.println("<script language=javascript> alert('"+ delsubject.getMsg() + "'); history.back();</script>");	
}
%>
<%
}}
%>